package com.psq.core.common.network.interceptor

import okhttp3.Interceptor
import okhttp3.Response

/**
 * 公共参数
 */
class BasicParamsInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val originalRequest = chain.request()
        val originalHttpUrl = originalRequest.url
        val url = originalHttpUrl.newBuilder().apply {
//            addQueryParameter("version", "${Build.VERSION.SDK_INT}")
        }.build()
        val request = originalRequest.newBuilder()
            .url(url)
            .method(originalRequest.method, originalRequest.body)
            .build()
        return chain.proceed(request)
    }
}